class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }
}
const person = new Person("coderqian", 20);

function myInstance(obj, className) {
  let pointer = obj;
  while (pointer) {
    if (pointer == className.prototype) {
      return true;
    }
    pointer = pointer.__proto__;
  }
  return false;
}
console.log("is ", myInstance(person, Person));
